<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
if($_RQ['op']=='main'){
		
	$id = intval($_RQ['id']);
		if (empty($id)) 
		{
			exi('参数错误','error','/index/');
		}
		$board = pdo_get('jy_sns_board',array('id'=>$id));
		if (empty($board)) 
		{	
			exi('未找到版块','error','/index/');	
		}
		
		$member = pdo_get('core_members',array('id'=>$_SESSION['uid']));
		$isManager = isManager($board['id']);
		$isSuperManager = isSuperManager();
		if (!($isManager) && !($isSuperManager)) 
		{
			$check = check($member, $board);
			
		}
		$return['board']=$board;
		$return['member']=$member;
		$return['check']=$check;
		$return['list']=pdo_getall('jy_sns_board',array('cid'=>$board['cid'],'uniacid'=>$_SESSION['uniacid'],'status'=>1),array('logo','title','desc'));
		foreach($return['list'] as &$row){
			$row['logo'] = tomedia($row['logo']);
			$row['postcount'] =getPostCount($row['id']);
			$row['followcount'] =getFollowCount($row['id']);
		}
		exi($return);
	}
?>